import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from '../views/home.vue'
import Class from '../views/class.vue'
import Cart from '../views/cart.vue'
import My from '../views/my.vue'
import No from '../views/no404.vue'

import Era from "../views/homes/era.vue"
import Erb from "../views/homes/erb.vue"
import Erc from "../views/homes/erc.vue"
import Erd from "../views/homes/erd.vue"
import Ere from "../views/homes/ere.vue"

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:"/home"
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children:[
      {
        path:"/era",
        name:"Era",
        component:Era
      },
      {
        path:"/erb",
        name:"Erb",
        component:Erb
      },
      {
        path:"/erc",
        name:"Erc",
        component:Erc
      },
      {
        path:"/erd",
        name:"Erd",
        component:Erd
      },
      {
        path:"/ere",
        name:"Ere",
        component:Ere
      },
    ]
  },
  {
    path: '/class',
    name: 'Class',
    component: Class
  },
  {
    path: '/cart',
    name: 'Cart',
    component: Cart
  },
  {
    path: '/my',
    name: 'My',
    component: My
  },
  {
    path: '*',
    name: 'No',
    component: No
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
